
	<form id="myForm" class="form-horizontal" autocomplete="off" data-validator-option="{theme:'default'}">
		<input type="hidden" name="id" value="$!{surfaceWaterGW.id}" id="gid">
		<div class="form-group" style="padding-top: 3%"><label class="col-sm-2 control-label" style="margin: 0 auto">流域名称:</label>
			<div class="col-sm-10 d1">
				<input type="text" class="form-control"  name="waterShed_name" id="waterShed_name"  value="$!{surfaceWaterGW.waterShed_name}" placeholder="请输入该途径名称" data-rule="名称:required;waterShed_name">
			</div>
		</div>
		<div class="form-group"><label class=" control-label" style="margin: 0 auto">地下水到地表水:</label>
		</div>
		<div class="form-group"><label class=" control-label" style="margin: 0 auto">污染物释放可能性因子值:</label>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">1.污染物释放可能性因子值:</label>
			<div class="col-sm-10 d2">
				<!--<input type="hidden" class="form-control" name="likelihood_of_exposure"  >-->
				<select name="observed_release" value="$!{surfaceWaterGW.observed_release}" class="form-control" id="observed_releaseG"style="width: 50%">
					<option>0</option>
					<option>550</option>
				</select>
			</div>
		</div>
		<div class="form-group"><label class=" control-label" style="margin: 0 auto">2.释放可能性因子值:</label>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">2a.污染源围堵因子值:<a onclick="surface(this.name)" name="3-2">(3-2)</a></label>
			<div class="col-sm-10 d2">
				<!--<input type="hidden" class="form-control" name="likelihood_of_exposure"  >-->
				<select  id="containmentG" name="containment" value="$!{surfaceWaterGW.containment}" class="form-control" style="width: 50%">
					<option>0</option>
					<option>3</option>
					<option>5</option>
					<option>7</option>
					<option>9</option>
					<option>10</option>
				</select>
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">2b.地下水途径降雨因子值:<a onclick="surface(this.name)" name="3-4">(3-4)</a></label>
			<div class="col-sm-10 d2">
				<!--<input type="hidden" class="form-control" name="likelihood_of_exposure"  >-->
				<select name="net_precip"  value="$!{surfaceWaterGW.net_precip}" class="form-control" id="net_precipG"style="width: 50%">
					<option>0</option>
					<option>1</option>
					<option>3</option>
					<option>6</option>
					<option>10</option>
				</select>
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">2c.含水层深度因子值:<a onclick="surface(this.name)" name="3-5">(3-5)</a></label>
			<div class="col-sm-10 d2">
				<!--<input type="hidden" class="form-control" name="likelihood_of_exposure"  >-->
				<select name="depth_to_auuifer" value="$!{surfaceWaterGW.depth_to_auuifer}" class="form-control" id="depth_to_auuiferG"style="width: 50%">
					<option>1</option>
					<option>3</option>
					<option>5</option>
				</select>
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">2d.运移时间因子值:<a onclick="surface(this.name)" name="3-7">(3-7)</a></label>
			<div class="col-sm-10 d2">
				<!--<input type="hidden" class="form-control" name="likelihood_of_exposure"  >-->
				<select name="travel_time" value="$!{surfaceWaterGW.travel_time}" class="form-control" id="travel_timeG"style="width: 50%">
					<option>1</option>
					<option>5</option>
					<option>15</option>
					<option>25</option>
					<option>35</option>
				</select>
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">2e.潜在污染物释放可能性因子值:</label>
			<div class="col-sm-10 d1">
				<input type="text" class="form-control"  name="potential_to_release" id="potential_to_releaseG"  value="#if ( $surfaceWaterGW )  $!{surfaceWaterGW.potential_to_release}  #else  0  #end" readonly>
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">3.污染物释放可能性因子值:</label>
			<div class="col-sm-10 d1">
				<input type="text" class="form-control"  name="likeihood_release" id="likeihood_releaseG" value="#if ( $surfaceWaterGW )  $!{surfaceWaterGW.likeihood_release}  #else  0  #end" readonly>
			</div>
		</div>
		<div class="hr-line-dashed"></div>


		<!--饮用水-->
		<div class="form-group"><label class=" control-label" style="margin: 0 auto">污染物特征因子值:</label>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">4.毒性/持久性:
			<button class="btn btn-info" onclick="openThreat('dwThreatG','dwFadeG');return false;">移动性</button>
		</label>






			<div id="dwThreatG" class="white_content">
				<div class="threatTop">
					<a href = "javascript:void(0)" onclick = "closeThreat('dwThreatG','dwFadeG')" >
						<p style="font-size: 30px;margin-left:95%;display: inline">×</p></a>
				</div>
				<div class="col-sm-10 d2" style="width: 100%;margin-top: 5%">
					<div style="display: inline;float: left;width: 50%;margin-left: 7%">
						<label class=" control-label" style="margin: 0 auto">选择主要元素:</label><br>
						<select id="threat1G" multiple="multiple" size="6"  class="form-control"style="height: 10%;display: inline">
						</select>
						<button onclick = "closeThreat('dwThreatG','dwFadeG'),maxPersistenceCaculate('PerToxG','substance','persistence','haza_quantityG','waste_characteristicsG');return false;" class="btn btn-info">
							保存并返回</button>
					</div>
					<div style="display: inline;float: right">
						<label class=" control-label" style="font-size: medium;margin: 0 auto">选择主要的水类:</label><br>
						<input type="radio" name="water_category" value="lake" id="lakeG" onclick=changeThreat('threat1G','waterCategory','lake','water')><label style="font-size: 15px;margin-left: 3px">湖泊</label><br>
						<input type="radio" name="water_category" value="river" id="riverG" onclick=changeThreat('threat1G','waterCategory','river','water')><label style="font-size: 15px;margin-left: 3px">河流</label><br>

						<label class=" control-label" style="font-size: medium;margin: 0 auto">选择流动方式:</label><br>
						<input type="radio" name="mob_type" value="MOBLK" id="MOBLKG" onclick=changeThreat('threat1G','mobType','MOBLK','water')><label style="font-size: 15px;margin-left: 3px">液体/喀斯特</label><br>
						<input type="radio" name="mob_type" value="MOBLNK" id="MOBLNKG" onclick=changeThreat('threat1G','mobType','MOBLNK','water')><label style="font-size: 15px;margin-left: 3px">液体/非喀斯特</label><br>
						<input type="radio" name="mob_type" value="MOBNLK" id="MOBNLKG" onclick=changeThreat('threat1G','mobType','MOBNLK','water')><label style="font-size: 15px;margin-left: 3px">非液体/喀斯特</label><br>
						<input type="radio" name="mob_type" value="MOBNLNK" id="MOBNLNKG" onclick=changeThreat('threat1G','mobType','MOBNLNK','water')><label style="font-size: 15px;margin-left: 3px">非液体/非喀斯特</label><br>
						<input type="radio" name="mob_type" value="InOR" id="InORG" onclick=changeThreat('threat1G','mobType','InOR','water')><label style="font-size: 15px;margin-left: 3px">处于可观察范围</label><br>

					</div>
				</div>
				<div style="padding-top: 30%;">
					<table width="90%" class="tableThreat" id="tableThreatG">

					</table>
				</div>
			</div>
			<div id="dwFadeG" class="black_overlay"></div>






			<div class="col-sm-10 d1">
				<input type="text" class="form-control" name="persistence" id="persistence"   value="1" readonly>
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">使用物质:</label>
			<div class="col-sm-10 d2">
				<!--<input type="hidden" class="form-control" name="substance"  >-->
				<select name="substance" id="substanceG" class="form-control"style="width: 50%">
				</select>
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">5.污染物数量因子值:</label>
			<div class="col-sm-10 d1">
				<input type="text" class="form-control"  name="haza_quantity" id="haza_quantityG"  value="1" readonly>
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">6.污染物特征因子值:</label>
			<div class="col-sm-10 d1">
				<input type="text" class="form-control"  name="waste_characteristics" id="waste_characteristicsG"  value="10" readonly>
			</div>
		</div>
		<div class="hr-line-dashed"></div>
		<div class="form-group"><label class=" control-label" style="margin: 0 auto">目标因子值:</label>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">7.取水口目标因子值:</label>
			<div class="col-sm-10 d2">
				<!--<input type="hidden" class="form-control" name="likelihood_of_exposure"  >-->
				<select name="nearest_intake" value="$!{surfaceWaterGW.nearest_intake}" class="form-control" id="nearest_intakeG"style="width: 50%">
					<option>0</option>
					<option>2</option>
					<option>10</option>
					<option>20</option>
					<option>45</option>
					<option>50</option>
				</select>
			</div>
		</div>
		<div class="form-group"><label class=" control-label" style="margin: 0 auto">8.人口目标因子值:</label>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">8a.暴露于水平1浓度的人口数量：</label>
			<div class="col-sm-10 d1">
				<input type="text"  class="form-control" id="pop_concent1G" name="pop_concent1"  placeholder="请输入该目标因子值" data-rule="人口目标因子值1:required;pop_concent1" value="$!{surfaceWaterGW.pop_concent1}">
				<div class="alert alert-warning alert-dismissible" role="alert" style="display: none" id="10aErrMsg">
					<!--data-dismiss="alert" aria-label="Close"-->
					<button type="button" class="close"  id="10aMsg" onclick="closeErr(this.id);return false;"><span aria-hidden="true">&times;</span></button>
					<strong>错误!</strong> 请输入正确数值！
				</div>
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">8b.暴露于水平2浓度的人口数量：</label>
			<div class="col-sm-10 d1">
				<input type="text"  class="form-control" id="pop_concent2G" name="pop_concent2"  placeholder="请输入该目标因子值" data-rule="人口目标因子值2:required;pop_concent2" value="$!{surfaceWaterGW.pop_concent2}">
				<div class="alert alert-warning alert-dismissible" role="alert" style="display: none" id="10bErrMsg">
					<!--data-dismiss="alert" aria-label="Close"-->
					<button type="button" class="close"  id="10bMsg" onclick="closeErr(this.id);return false;"><span aria-hidden="true">&times;</span></button>
					<strong>错误!</strong> 请输入正确数值！
				</div>
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">8c.暴露于潜在污染的人口数量：</label>
			<div class="col-sm-10 d1">
				<input type="text"  class="form-control" id="potential_contanminationG" name="potential_contanmination"  placeholder="请输入该目标因子值" data-rule="潜在人口目标因子值:required;potential_contanmination" value="$!{surfaceWaterGW.potential_contanmination}">
				<div class="alert alert-warning alert-dismissible" role="alert" style="display: none" id="10cErrMsg">
					<!--data-dismiss="alert" aria-label="Close"-->
					<button type="button" class="close"  id="10cMsg" onclick="closeErr(this.id);return false;"><span aria-hidden="true">&times;</span></button>
					<strong>错误!</strong> 请输入正确数值！
				</div>
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">8d.人口目标因子值:</label>
			<div class="col-sm-10 d1">
				<input type="text" class="form-control" id="populationG" name="population"  value="#if ( $surfaceWaterGW )  $!{surfaceWaterGW.population}  #else  0  #end" readonly>
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">9.资源目标因子值:</label>
			<div class="col-sm-10 d2">
				<!--<input type="hidden" class="form-control" name="likelihood_of_exposure"  >-->
				<select name="resource" value="$!{surfaceWaterGW.resource}" class="form-control" id="resourceG"style="width: 50%">
					<option>0</option>
					<option>5</option>
				</select>
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">10.目标因子值:</label>
			<div class="col-sm-10 d1">
				<input type="text" class="form-control" id="targetG" name="target"  value="#if ( $surfaceWaterGW ) $!{surfaceWaterGW.target}  #else  0  #end" readonly>
			</div>
		</div>
		<div class="hr-line-dashed"></div>
		<div class="form-group"><label class=" control-label" style="margin: 0 auto">饮用水威胁评分:</label>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">11.饮用水威胁评分:</label>
			<div class="col-sm-10 d1">
				<input type="text" class="form-control" id="drinking_water_scoreG" name="drinking_water_score"  value="#if ( $surfaceWaterGW ) $!{surfaceWaterGW.drinking_water_score}  #else  0  #end" readonly>
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label" >未经扫描得分:</label>
			<div class="col-sm-10 d1">
				<input type="text" class="form-control" name="uncapped_score"  value="#if ( $surfaceWaterGW ) $!{surfaceWaterGW.uncapped_score}  #else  0  #end" readonly id="uncapped_scoreG">
			</div>
		</div>
		<div class="hr-line-dashed"></div>



		<!--食物链-->
		<div class="form-group"><label class="col-sm-2 control-label">12.污染物释放可能性因子值:</label>
			<div class="col-sm-10 d1">
				<input type="text" class="form-control"  name="likeihood_release2" id="likeihood_release2G" value="#if ( $surfaceWaterGW ) $!{surfaceWaterGW.likeihood_release}  #else  0  #end" readonly>
			</div>
		</div>
		<div class="hr-line-dashed"></div>
		<div class="form-group"><label class=" control-label" style="margin: 0 auto">污染物特征因子值:</label>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">13.毒性/持久性/生物积累性:
		</label>

		</div>
		<div class="form-group"><label class="col-sm-2 control-label">13a.毒性/持久性:
			<button class="btn btn-info" onclick="openThreat('dwThreat2G','dwFade2G');return false;">移动性</button>
		</label>



			<div id="dwThreat2G" class="white_content">
				<div class="threatTop">
					<a href = "javascript:void(0)" onclick = "closeThreat('dwThreat2G','dwFade2G')" >
						<p style="font-size: 30px;margin-left:95%;display: inline">×</p></a>
				</div>
				<div class="col-sm-10 d2" style="width: 100%;margin-top: 5%">
					<div style="display: inline;float: left;width: 50%;margin-left: 7%">
						<label class=" control-label" style="margin: 0 auto">选择主要元素:</label><br>
						<select id="threat2G" multiple="multiple" size="6"  class="form-control"style="height: 200px;display: inline">
						</select><br><br>
						<button onclick = "closeThreat('dwThreat2G','dwFade2G'),maxPersistenceCaculate('PerTox2G','substance2','persistence2','haza_quantity2G','waste_characteristics2G');return false;" class="btn btn-info">
							保存并返回</button>
					</div>
					<div style="display: inline;float: right">
						<label class=" control-label" style="font-size: medium;margin: 0 auto">选择主要的水类:</label><br>
						<input type="radio" name="water_category2" value="lake" id="lake2G" onclick=changeThreat('threat2G','waterCategory2','lake','food')><label style="font-size: 15px;margin-left: 3px">湖泊</label><br>
						<input type="radio" name="water_category2" value="river" id="river2G" onclick=changeThreat('threat2G','waterCategory2','river','food')><label style="font-size: 15px;margin-left: 3px">河流</label><br>

						<label class=" control-label" style="font-size: medium;margin: 0 auto">选择流动方式:</label><br>
						<input type="radio" name="mob_type2" value="MOBLK" id="MOBLK2G" onclick=changeThreat('threat2G','mobType2','MOBLK','food')><label style="font-size: 15px;margin-left: 3px">液体/喀斯特</label><br>
						<input type="radio" name="mob_type2" value="MOBLNK" id="MOBLNK2G" onclick=changeThreat('threat2G','mobType2','MOBLNK','food')><label style="font-size: 15px;margin-left: 3px">液体/非喀斯特</label><br>
						<input type="radio" name="mob_type2" value="MOBNLK" id="MOBNLK2G" onclick=changeThreat('threat2G','mobType2','MOBNLK','food')><label style="font-size: 15px;margin-left: 3px">非液体/喀斯特</label><br>
						<input type="radio" name="mob_type2" value="MOBNLNK" id="MOBNLNK2G" onclick=changeThreat('threat2G','mobType2','MOBNLNK','food')><label style="font-size: 15px;margin-left: 3px">非液体/非喀斯特</label><br>
						<input type="radio" name="mob_type2" value="InOR" id="InOR2G" onclick=changeThreat('threat2G','mobType2','InOR','food')><label style="font-size: 15px;margin-left: 3px">处于可观察范围</label><br>

						<label class=" control-label" style="font-size: medium;margin: 0 auto">选择水体类型:</label><br>
						<input type="radio" name="body_type" value="fresh" id="freshG" onclick=changeThreat('threat2G','bodyType','fresh','food')><label style="font-size: 15px;margin-left: 3px">淡水</label><br>
						<input type="radio" name="body_type" value="salt" id="saltG" onclick=changeThreat('threat2G','bodyType','salt','food')><label style="font-size: 15px;margin-left: 3px">咸水</label><br>
					</div>
				</div>
				<div style="padding-top: 30%;">
					<table width="90%" class="tableThreat" id="tableThreat2G">

					</table>
				</div>
			</div>
			<div id="dwFade2G" class="black_overlay"></div>






            <div class="col-sm-10 d1">
                <input type="text" class="form-control" name="persistence2" id="persistence2"   value="1" readonly>
            </div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">使用物质:</label>
			<div class="col-sm-10 d2">
				<!--<input type="hidden" class="form-control" name="substance"  >-->
				<select name="substance2" id="substance2G"   class="form-control"style="width: 50%">

				</select>
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">13b.生物积累性:</label>
			<div class="col-sm-10 d2">
				<!--<input type="hidden" class="form-control" name="likelihood_of_exposure"  >-->
				<select name="bioa_val" value="" class="form-control" id="bioa_valG"style="width: 50%">
					<option>0.5</option>
					<option>5</option>
					<option>50</option>
					<option>500</option>
					<option>5000</option>
					<option>50000</option>
				</select>
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">14.污染物数量因子值:</label>
			<div class="col-sm-10 d1">
				<input type="text" class="form-control"  name="haza_quantity2" id="haza_quantity2G"  value="1" readonly>
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">15.污染物特征因子值:</label>
			<div class="col-sm-10 d1">
				<input type="text" class="form-control"  name="waste_characteristics2" id="waste_characteristics2G"  value="56" readonly>
			</div>
		</div>
		<div class="hr-line-dashed"></div>
		<div class="form-group"><label class=" control-label" style="margin: 0 auto">目标因子值:</label>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">16.个人目标因子值:</label>
			<div class="col-sm-10 d2">
				<!--<input type="hidden" class="form-control" name="likelihood_of_exposure"  >-->
				<select name="food_chain_individual" value="" class="form-control" id="food_chain_individualG"style="width: 50%">
					<option>0</option>
					<option>20</option>
					<option>45</option>
					<option>50</option>
				</select>
			</div>
		</div>
		<div class="form-group"><label class=" control-label" style="margin: 0 auto">17.人口目标因子值:</label>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">17a.暴露于水平1浓度的人口数量：</label>
			<div class="col-sm-10 d1">
				<input type="text"  class="form-control" id="pop_concent12G" name="pop_concent12"  placeholder="请输入该目标因子值" data-rule="人口目标因子值1:required;pop_concent1" value="$!{surfaceWaterGW.pop_concent12}">
				<div class="alert alert-warning alert-dismissible" role="alert" style="display: none" id="19aErrMsg">
					<!--data-dismiss="alert" aria-label="Close"-->
					<button type="button" class="close"  id="19aMsg" onclick="closeErr(this.id);return false;"><span aria-hidden="true">&times;</span></button>
					<strong>错误!</strong> 请输入正确数值！
				</div>
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">17b.暴露于水平2浓度的人口数量：</label>
			<div class="col-sm-10 d1">
				<input type="text"  class="form-control" id="pop_concent22G" name="pop_concent22"  placeholder="请输入该目标因子值" data-rule="人口目标因子值2:required;pop_concent2" value="$!{surfaceWaterGW.pop_concent22}">
				<div class="alert alert-warning alert-dismissible" role="alert" style="display: none" id="19bErrMsg">
					<!--data-dismiss="alert" aria-label="Close"-->
					<button type="button" class="close"  id="19bMsg" onclick="closeErr(this.id);return false;"><span aria-hidden="true">&times;</span></button>
					<strong>错误!</strong> 请输入正确数值！
				</div>
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">17c.暴露于潜在污染的人口数量：</label>
			<div class="col-sm-10 d1">
				<input type="text"  class="form-control" id="pot_HFC_concentG" name="pot_HFC_concent"  placeholder="请输入该目标因子值" data-rule="潜在人口目标因子值:required;pot_HFC_concent" value="$!{surfaceWaterGW.pot_HFC_concent}">
				<div class="alert alert-warning alert-dismissible" role="alert" style="display: none" id="19cErrMsg">
					<!--data-dismiss="alert" aria-label="Close"-->
					<button type="button" class="close"  id="19cMsg" onclick="closeErr(this.id);return false;"><span aria-hidden="true">&times;</span></button>
					<strong>错误!</strong> 请输入正确数值！
				</div>
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">17d.人口目标因子值:</label>
			<div class="col-sm-10 d1">
				<input type="text" class="form-control" id="population2G" name="population2"  value="#if ( $surfaceWaterGW ) $!{surfaceWaterGW.population2}  #else  0  #end" readonly>
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">18.目标因子值:</label>
			<div class="col-sm-10 d1">
				<input type="text" class="form-control" id="target2G" name="target2"  value="#if ( $surfaceWaterGW ) $!{surfaceWaterGW.target2}  #else  0  #end" readonly>
			</div>
		</div>
		<div class="hr-line-dashed"></div>
		<div class="form-group"><label class=" control-label" style="margin: 0 auto">食物链威胁评分:</label>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">19.食物链威胁评分:</label>
			<div class="col-sm-10 d1">
				<input type="text" class="form-control" id="human_food_chain_scoreG" name="human_food_chain_score"  value="#if ( $surfaceWaterGW ) $!{surfaceWaterGW.human_food_chain_score}  #else  0  #end" readonly>
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label" >未经扫描得分:</label>
			<div class="col-sm-10 d1">
				<input type="text" class="form-control" name="uncapped_score2"  value="#if ( $surfaceWaterGW ) $!{surfaceWaterGW.uncapped_score2}  #else  0  #end" readonly id="uncapped_score2G">
			</div>
		</div>
		<div class="hr-line-dashed"></div>
		<div class="form-group"><label class="col-sm-2 control-label">20.污染物释放可能性因子值:</label>
			<div class="col-sm-10 d1">
				<input type="text" class="form-control"  name="likeihood_release3" id="likeihood_release3G" value="#if ( $surfaceWaterGW ) $!{surfaceWaterGW.likeihood_release}  #else  0  #end" readonly>
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">21.毒性/持久性/生物积累性:
		</label>

		</div>
		<div class="form-group"><label class="col-sm-2 control-label">21a.毒性/持久性:
			<button class="btn btn-info" onclick = "openThreat('dwThreat3G','dwFade3G');return false;">移动性</button>
		</label>



			<div id="dwThreat3G" class="white_content">
				<div class="threatTop">
					<a href = "javascript:void(0)" onclick = "closeThreat('dwThreat3G','dwFade3G')" >
						<p style="font-size: 30px;margin-left:95%;display: inline">×</p></a>
				</div>
				<div class="col-sm-10 d2" style="width: 100%;margin-top: 5%">
					<div style="display: inline;float: left;width: 50%;margin-left: 7%">
						<label class=" control-label" style="margin: 0 auto">选择主要元素:</label><br>
						<select id="threat3G" multiple="multiple" size="6"  class="form-control"style="height: 200px;display: inline">
						</select><br><br>
						<button onclick = "closeThreat('dwThreat3G','dwFade3G'),maxPersistenceCaculate('PerTox3G','substance3','persistence3','haz_waster_quantityG','waste_chaG');return false;" class="btn btn-info">
							保存并返回</button>
					</div>
					<div style="display: inline;float: right">
						<label class=" control-label" style="font-size: medium;margin: 0 auto">选择主要的水类:</label><br>
						<input type="radio" name="water_category3" value="lake" id="lake3G" onclick=changeThreat('threat3G','waterCategory3','lake','environment')><label style="font-size: 15px;margin-left: 3px">湖泊</label><br>
						<input type="radio" name="water_category3" value="river" id="river3G" onclick=changeThreat('threat3G','waterCategory3','river','environment')><label style="font-size: 15px;margin-left: 3px">河流</label><br>

						<label class=" control-label" style="font-size: medium;margin: 0 auto">选择流动方式:</label><br>
						<input type="radio" name="mob_type3" value="MOBLK" id="MOBLK3G" onclick=changeThreat('threat3G','mobType3','MOBLK','environment')><label style="font-size: 15px;margin-left: 3px">液体/喀斯特</label><br>
						<input type="radio" name="mob_type3" value="MOBLNK" id="MOBLNK3G" onclick=changeThreat('threat3G','mobType3','MOBLNK','environment')><label style="font-size: 15px;margin-left: 3px">液体/非喀斯特</label><br>
						<input type="radio" name="mob_type3" value="MOBNLK" id="MOBNLK3G" onclick=changeThreat('threat3G','mobType3','MOBNLK','environment')><label style="font-size: 15px;margin-left: 3px">非液体/喀斯特</label><br>
						<input type="radio" name="mob_type3" value="MOBNLNK" id="MOBNLNK3G" onclick=changeThreat('threat3G','mobType3','MOBNLNK','environment')><label style="font-size: 15px;margin-left: 3px">非液体/非喀斯特</label><br>
						<input type="radio" name="mob_type3" value="InOR" id="InOR3G" onclick=changeThreat('threat3G','mobType3','InOR','environment')><label style="font-size: 15px;margin-left: 3px">处于可观察范围</label><br>

						<label class=" control-label" style="font-size: medium;margin: 0 auto">选择水体类型:</label><br>
						<input type="radio" name="body_type3" value="fresh" id="fresh2G" onclick=changeThreat('threat3G','bodyType','fresh','environment')><label style="font-size: 15px;margin-left: 3px">淡水</label><br>
						<input type="radio" name="body_type3" value="salt" id="salt2G" onclick=changeThreat('threat3G','bodyType','salt','environment')><label style="font-size: 15px;margin-left: 3px">咸水</label><br>
					</div>
				</div>
				<div style="padding-top: 30%;">
					<table width="90%" class="tableThreat" id="tableThreat3G">

					</table>
				</div>
			</div>
			<div id="dwFade3G" class="black_overlay"></div>







            <div class="col-sm-10 d1">
                <input type="text" class="form-control" name="persistence3" id="persistence3"   value="1" readonly>
            </div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">使用物质:</label>
			<div class="col-sm-10 d2">
				<!--<input type="hidden" class="form-control" name="substance"  >-->
				<select name="substance3"  class="form-control" id="substance3G" style="width: 50%">
				</select>
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">21b.生物积累性:</label>
			<div class="col-sm-10 d2">
				<!--<input type="hidden" class="form-control" name="likelihood_of_exposure"  >-->
				<select name="ecosystem_bap_value" id="ecosystem_bap_valueG" value="" class="form-control"  style="width: 50%">
					<option>0.5</option>
					<option>5</option>
					<option>50</option>
					<option>500</option>
					<option>5000</option>
					<option>50000</option>
				</select>
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">22.污染物数量因子值:</label>
			<div class="col-sm-10 d1">
				<input type="text" class="form-control"  name="haz_waster_quantity" id="haz_waster_quantityG"  value="1" readonly>
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">23.污染物特征因子值:</label>
			<div class="col-sm-10 d1">
				<input type="text" class="form-control"  name="waste_cha" id="waste_chaG"  value="100" readonly>
			</div>
		</div>
		<div class="hr-line-dashed"></div>
		<div class="form-group"><label class=" control-label" style="margin: 0 auto">目标因子值:</label>
		</div>
		<div class="form-group"><label class=" control-label" style="margin: 0 auto">24.敏感环境目标因子值:<a onclick="surface(this.name)" name="4-23">(4-23)</a><a onclick="surface(this.name)" name="4-24">(4-24)</a></label>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">24a.暴露于水平1浓度的目标因子值：</label>
			<div class="col-sm-10 d1">
				<input type="text"  class="form-control" id="pop_concent13G" name="pop_concent13"  placeholder="请输入该目标因子值" data-rule="人口目标因子值1:required;pop_concent1" value="$!{surfaceWaterGW.pop_concent13}">
				<div class="alert alert-warning alert-dismissible" role="alert" style="display: none" id="26aErrMsg">
					<!--data-dismiss="alert" aria-label="Close"-->
					<button type="button" class="close"  id="26aMsg" onclick="closeErr(this.id);return false;"><span aria-hidden="true">&times;</span></button>
					<strong>错误!</strong> 请输入正确数值！
				</div>
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">24b.暴露于水平2浓度的目标因子值：</label>
			<div class="col-sm-10 d1">
				<input type="text"  class="form-control" id="pop_concent23G" name="pop_concent23"  placeholder="请输入该目标因子值" data-rule="人口目标因子值2:required;pop_concent23" value="$!{surfaceWaterGW.pop_concent23}">
				<div class="alert alert-warning alert-dismissible" role="alert" style="display: none" id="26bErrMsg">
					<!--data-dismiss="alert" aria-label="Close"-->
					<button type="button" class="close"  id="26bMsg" onclick="closeErr(this.id);return false;"><span aria-hidden="true">&times;</span></button>
					<strong>错误!</strong> 请输入正确数值！
				</div>
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">24c.暴露于潜在污染的目标因子值：</label>
			<div class="col-sm-10 d1">
				<input type="text"  class="form-control" id="potential_contanmination3G" name="potential_contanmination3"  placeholder="请输入该目标因子值" data-rule="潜在人口目标因子值:required;potential_contanmination" value="$!{surfaceWaterGW.potential_contanmination3}">
				<div class="alert alert-warning alert-dismissible" role="alert" style="display: none" id="26cErrMsg">
					<!--data-dismiss="alert" aria-label="Close"-->
					<button type="button" class="close"  id="26cMsg" onclick="closeErr(this.id);return false;"><span aria-hidden="true">&times;</span></button>
					<strong>错误!</strong> 请输入正确数值！
				</div>
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">24d.敏感环境目标因子值:</label>
			<div class="col-sm-10 d1">
				<input type="text" class="form-control" id="pop_sensitive_environmentsG" name="pop_sensitive_environments"  value="#if ( $surfaceWaterGW ) $!{surfaceWaterGW.pop_sensitive_environments}  #else  0  #end" readonly>
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">25.目标因子值:</label>
			<div class="col-sm-10 d1">
				<input type="text" class="form-control" id="target3G" name="target3"  value="#if ( $surfaceWaterGW ) $!{surfaceWaterGW.pop_sensitive_environments}  #else  0  #end" readonly>
			</div>
		</div>
		<div class="form-group"><label class=" control-label" style="margin: 0 auto">环境威胁评分:</label>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">26.环境威胁评分:</label>
			<div class="col-sm-10 d1">
				<input type="text" class="form-control" id="environment_scoreG" name="environment_score"  value="#if ( $surfaceWaterGW ) $!{surfaceWaterGW.environment_score}  #else  0  #end" readonly>
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label" >未经扫描得分:</label>
			<div class="col-sm-10 d1">
				<input type="text" class="form-control" name="uncapped_score3"  value="#if ( $surfaceWaterGW ) $!{surfaceWaterGW.uncapped_score3}  #else  0  #end" readonly id="uncapped_score3G">
			</div>
		</div>
		<div class="hr-line-dashed"></div>
		<div class="form-group"><label class="col-sm-2 control-label" >地表水/地表径流总分:</label>
			<div class="col-sm-10 d1">
				<input type="text" class="form-control" name="watershed_score"  value="#if ( $surfaceWaterGW ) $!{surfaceWaterGW.watershed_score}  #else  0  #end" readonly id="watershed_scoreG">
			</div>
		</div>
		<div class="hr-line-dashed"></div>
		<div class="form-group">
			<div class="text-center">
				<a class="btn btn-primary btn-next" href="#springUrl('/surfaceWater/index/')${siteId}/0/0/0" >  <  </a>
				<button class="btn btn-primary" type="submit">保 存</button>
				<a class="btn btn-primary btn-next" href="#springUrl('/soil/add/')${siteId}" >  >  </a>
			</div>
		</div>
	</form>
	<div class="row ibox-content" style="margin:3%;padding: 4% 2%">
		<div id="tabContainer"></div>
		<div class="row">
			<div class="col-sm-12">
				<table width="100%" class="tableThreat" id="tableIndex2">
				</table>

			</div>
		</div>
	</div>


<!--<script src="#springUrl('/static/js/plugins/bootstrap-table/bootstrap-table.min.js')"></script>
<script src="#springUrl('/static/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js')"></script>
<script src="#springUrl('/static/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js')"></script>
&lt;!&ndash;<script src="#springUrl('/static/js/base_list.js')"></script>&ndash;&gt;
<script src="#springUrl('/static/js/common.js')"></script>
&lt;!&ndash;<script src="#springUrl('/static/js/jquery-2.1.1.js')"></script>&ndash;&gt;
<script src="#springUrl('/static/plugins/layer-v2.2/layer/layer.js')"></script>
&lt;!&ndash;<script src="#springUrl('/static/plugins/nice-validator-0.8.1/jquery.validator.js?local=zh-CN')"></script>&ndash;&gt;
<script src="#springUrl('/static/plugins/nice-validator-0.8.1/jquery.validator.js')"></script>-->
	<script src="#springUrl('/static/js/plugins/bootstrap-table/bootstrap-table.min.js')"></script>
	<script src="#springUrl('/static/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js')"></script>
	<script src="#springUrl('/static/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js')"></script>
	<script src="#springUrl('/static/js/common.js')"></script>
	<script src="#springUrl('/static/plugins/layer-v2.2/layer/layer.js')"></script>
	<script src="#springUrl('/static/js/lib/less.js')"></script>
	<script src="#springUrl('/static/js/lib/jquery.min.js')"></script>
	<script src="#springUrl('/static/js/lib/lib.js')"></script>
	<script src="#springUrl('/static/plugins/nice-validator-0.8.1/jquery.validator.js?local=zh-CN')"></script>

<script type="text/javascript">


    var tableThreat = document.getElementById('tableThreatG');
    var tableThreat2 = document.getElementById('tableThreat2G');
    var tableThreat3 = document.getElementById('tableThreat3G');
    var roleList=JSON.parse('${gWList}');
    var observed_release =$('#observed_releaseG');
    var containment =$('#containmentG');
    var net_precip =$('#net_precipG');
    var depth_to_auuifer =$('#depth_to_auuiferG');
    var travel_time =$('#travel_timeG');
    var potential_to_release =$('#potential_to_releaseG');
    var likeihood_release =$('#likeihood_releaseG');
    var haza_quantity =$('#haza_quantityG');
    var waste_characteristics =$('#waste_characteristicsG');
    var nearest_intake =$('#nearest_intakeG');
    var pop_concent1 =$('#pop_concent1G');
    var pop_concent2 =$('#pop_concent2G');
    var potential_contanmination =$('#potential_contanminationG');
    var population =$('#populationG');
    var resource =$('#resourceG');
    var target =$('#targetG');
    var drinking_water_score =$('#drinking_water_scoreG');
    var uncapped_score =$('#uncapped_scoreG');
    var likeihood_release2 =$('#likeihood_release2G');
    var haza_quantity2 =$('#haza_quantity2G');
    var waste_characteristics2 =$('#waste_characteristics2G');
    var food_chain_individual =$('#food_chain_individualG');
    var pop_concent12 =$('#pop_concent12G');
    var pop_concent22 =$('#pop_concent22G');
    var pot_HFC_concent =$('#pot_HFC_concentG');
    var population2 =$('#population2G');
    var target2 =$('#target2G');
    var human_food_chain_score =$('#human_food_chain_scoreG');
    var uncapped_score2 =$('#uncapped_score2G');
    var likeihood_release3 =$('#likeihood_release3G');
    var haz_waster_quantity =$('#haz_waster_quantityG');
    var waste_cha =$('#waste_chaG');
    var pop_concent13 =$('#pop_concent13G');
    var pop_concent23 =$('#pop_concent23G');
    var potential_contanmination3 =$('#potential_contanmination3G');
    var pop_sensitive_environments =$('#pop_sensitive_environmentsG');
    var target3 =$('#target3G');
    var environment_score =$('#environment_scoreG');
    var uncapped_score3 =$('#uncapped_score3G');
    var watershed_score =$('#watershed_scoreG');
    var bioa_valG = $('#bioa_valG');
    var ecosystem_bap_valueG = $('#ecosystem_bap_valueG');
    var persistence2 = $('#persistence2');
    var persistence3 = $('#persistence3');
    var sdList=JSON.parse('${sdList}');
    var type = new Array;
    for(t = 0;t<sdList.length;t++) {
        if(sdList[t].select_type!=null){
            type[t] = JSON.parse(sdList[t].select_type);
        }else{
            type[t] = new Object();
            type[t].mobType='MOBLK';
            type[t].waterCategory='lake';
            type[t].mobType2='MOBLK';
            type[t].waterCategory2='lake';
            type[t].bodyType='fresh';
            type[t].mobType3='MOBLK';
            type[t].waterCategory3='lake';
            type[t].bodyType2='fresh';
        }
    }


    var lakeG = document.getElementById('lakeG');
    var riverG = document.getElementById('riverG');
    var MOBLKG = document.getElementById('MOBLKG');
    var MOBLNKG = document.getElementById('MOBLNKG');
    var MOBNLKG = document.getElementById('MOBNLKG');
    var MOBNLNKG = document.getElementById('MOBNLNKG');
    var InORG = document.getElementById('InORG');

    var lake2G = document.getElementById('lake2G');
    var river2G = document.getElementById('river2G');
    var MOBLK2G = document.getElementById('MOBLK2G');
    var MOBLNK2G = document.getElementById('MOBLNK2G');
    var MOBNLK2G = document.getElementById('MOBNLK2G');
    var MOBNLNK2G = document.getElementById('MOBNLNK2G');
    var InOR2G = document.getElementById('InOR2G');
    var freshG = document.getElementById('freshG');
    var saltG = document.getElementById('saltG');

    var lake3G = document.getElementById('lake3G');
    var river3G = document.getElementById('river3G');
    var MOBLK3G = document.getElementById('MOBLK3G');
    var MOBLNK3G = document.getElementById('MOBLNK3G');
    var MOBNLK3G = document.getElementById('MOBNLK3G');
    var MOBNLNK3G = document.getElementById('MOBNLNK3G');
    var InOR3G = document.getElementById('InOR3G');
    var fresh2G = document.getElementById('fresh2G');
    var salt2G = document.getElementById('salt2G');

    function tableCreate() {
        var tdd="<tr><th>序号</th><th>名称</th><th>分数</th><th>是否计入评分</th><th>操作</th></tr>";
        for(i=0;i<roleList.length;i++){
            var score = roleList[i].score;
            if(score>100){
                score = 100;
            }
            var used = roleList[i].used;
            var isUsed;
            if(used==true){
                isUsed = "是";
            }else {
                isUsed = "否";
            }
            tdd+="<tr><td>"+(i+1)+"</td><td>"+roleList[i].name+"</td><td>"+score.toFixed(2)+"</td><td>"+isUsed+"</td>" +
                "<td><button class='btn btn-warning'  type='button' id='editSw"+i+"' onclick='editScore("+roleList[i].id+");return false;'>编辑</button>" +
                "<button class='btn btn-danger'  type='button' id='delSw"+i+"' onclick='delScore("+roleList[i].id+");return false;'>删除</button></td></tr>";
        }
        document.getElementById('tableIndex2').innerHTML = tdd;


    }

    //编辑功能
    function editScore(id) {
        window.parent.location.href = "#springUrl('/surfaceWater/index/"+siteId+"/0/"+id+"/1')";
    }

    //删除功能
    function delScore(id) {
    //    alert(id);

        $.ajax({
            type: 'POST',
            url: "#springUrl('/surfaceWater/delGroudScore')",
            data: $.param({'id':id,'siteId':siteId}),
            success: function (result) {
              //  alert(result.success);
                parent.layer.alert("删除成功",function(){
                    parent.layer.closeAll();
                    window.parent.location.reload();
                });
            },
            dataType: 'json'
        });
    }



    function decodeMessageG(){
        var tmp="";
        var tdd="<tr><th>元素</th><th>毒性</th><th>流动方式</th><th>持久值</th><th>毒性/持久性</th></tr>";
        var tdd2="<tr><th>元素</th><th>毒性</th><th>流动方式</th><th>持久值</th><th>累计值</th><th>毒性/持久性</th></tr>";
        var tdd3="<tr><th>元素</th><th>生态毒性</th><th>流动方式</th><th>持久值</th><th>累计值</th><th>毒性/持久性</th></tr>";
        var mob_value = 0;
		var mob_value2 = 0;
        var mob_value3 = 0;
		var Per_value = 0;
		var Per_value2 = 0;
        var Per_value3 = 0;
        var Bio_value = 0;
		var Bio_value2 = 0;
        var Ec_value = 0;
        for(i=0;i<sdList.length;i++){
            tmp+="<option onclick = getOptionG("+i+") >"+sdList[i].chnname+"</option>";

            if(type[i].mobType=="MOBLK"){
                mob_value = sdList[i].moblk;
			}else if(type[i].mobType=="MOBLNK"){
                mob_value = sdList[i].moblnk;
            }else if(type[i].mobType=="MOBNLK"){
                mob_value = sdList[i].mobnlk;
            }else if(type[i].mobType=="MOBNLNK"){
                mob_value = sdList[i].mobnlnk;
            }else if(type[i].mobType=="InOR"){
                mob_value = 1;
            }
            if (type[i].waterCategory=="lake"){
                Per_value = sdList[i].pers_lak;
            }else if(type[i].waterCategory=="river"){
                Per_value = sdList[i].pers_riv;
            }

            if(type[i].mobType2=="MOBLK"){
                mob_value2 = sdList[i].moblk;
            }else if(type[i].mobType2=="MOBLNK"){
                mob_value2 = sdList[i].moblnk;
            }else if(type[i].mobType2=="MOBNLK"){
                mob_value2 = sdList[i].mobnlk;
            }else if(type[i].mobType2=="MOBNLNK"){
                mob_value2 = sdList[i].mobnlnk;
            }else if(type[i].mobType2=="InOR"){
                mob_value2 = 1;
            }
            if (type[i].waterCategory2=="lake"){
                Per_value2 = sdList[i].pers_lak;
            }else if(type[i].waterCategory2=="river"){
                Per_value2 = sdList[i].pers_riv;
            }

            if (type[i].bodyType=="fresh"){
                Bio_value = sdList[i].bcff;
            }else if(type[i].bodyType=="salt"){
                Bio_value = sdList[i].bcfs;
            }

            if(type[i].mobType3=="MOBLK"){
                mob_value3 = sdList[i].moblk;
            }else if(type[i].mobType3=="MOBLNK"){
                mob_value3 = sdList[i].moblnk;
            }else if(type[i].mobType3=="MOBNLK"){
                mob_value3 = sdList[i].mobnlk;
            }else if(type[i].mobType3=="MOBNLNK"){
                mob_value3 = sdList[i].mobnlnk;
            }else if(type[i].mobType3=="InOR"){
                mob_value3 = 1;
            }
            if (type[i].waterCategory3=="lake"){
                Per_value3 = sdList[i].pers_lak;
            }else if(type[i].waterCategory3=="river"){
                Per_value3 = sdList[i].pers_riv;
            }

            if (type[i].bodyType2=="fresh"){
                Ec_value = sdList[i].bcfef;
                Bio_value2 = sdList[i].bcff;
            }else if(type[i].bodyType2=="salt"){
                Ec_value = sdList[i].bcfes;
                Bio_value2 = sdList[i].bcfs;
            }
            tdd+="<tr><td>"+sdList[i].chnname+"</td><td id='tox"+i+"'>"+sdList[i].tox+"</td><td id='mobValue"+i+"'>"+mob_value+"</td><td id='PerValueG"+i+"'>"+Per_value+"</td><td id='PerToxG"+i+"'>"+(mob_value*Per_value*sdList[i].tox).toFixed(3)+"</td>" +
				"<td style='display: none' id='moblk"+i+"'>"+sdList[i].moblk+"</td><td style='display: none' id='moblnk"+i+"'>"+sdList[i].moblnk+"</td><td style='display: none' id='mobnlk"+i+"'>"+sdList[i].mobnlk+"</td><td style='display: none' id='mobnlnk"+i+"'>"+sdList[i].mobnlnk+"</td><td style='display: none' id='persLake"+i+"'>"+sdList[i].pers_lak+"</td><td style='display: none' id='persRiv"+i+"'>"+sdList[i].pers_riv+"</td></tr>";
            tdd2+="<tr><td>"+sdList[i].chnname+"</td><td id='tox2"+i+"'>"+sdList[i].tox+"</td><td id='mobValue2"+i+"'>"+mob_value2+"</td><td id='PerValue2G"+i+"'>"+Per_value2+"</td><td id='Bio_value"+i+"'>"+Bio_value+"</td><td id='PerTox2G"+i+"'>"+(mob_value2*Per_value2*Bio_value*sdList[i].tox).toFixed(3)+"</td>"+
					"<td style='display: none;' id='foodFresh"+i+"'>"+sdList[i].bcff+"</td><td style='display: none;'id='foodSalt"+i+"'>"+sdList[i].bcfs+"</td>";
            tdd3+="<tr><td>"+sdList[i].chnname+"</td><td id='Ec_value"+i+"'>"+Ec_value+"</td><td id='mobValue3"+i+"'>"+mob_value3+"</td><td id='PerValue3G"+i+"'>"+Per_value3+"</td><td id='Bio_value2"+i+"'>"+Bio_value2+"</td><td id='PerTox3G"+i+"'>"+(mob_value3*Per_value3*Bio_value2*Ec_value).toFixed(3)+"</td>"+
			"<td style='display: none' id='EcFresh"+i+"'>"+sdList[i].bcfef+"</td><td style='display: none;' id='EcSalt"+i+"'>"+sdList[i].bcfes+"</td>";

        }

        document.getElementById("threat1G").innerHTML=tmp;
        document.getElementById("threat2G").innerHTML=tmp;
        document.getElementById("threat3G").innerHTML=tmp;
        tableThreat.innerHTML=tdd;
        tableThreat2.innerHTML=tdd2;
        tableThreat3.innerHTML=tdd3;
    }

    function getOptionG(i) {
        if (type[i].waterCategory=='lake'){
		//	alert(lakeG.checked);
			lakeG.click();
         //   alert(lakeG.checked);
        }else if(type[i].waterCategory=='river'){
          //  alert(river.checked);
            riverG.checked='checked';
           // alert(river.checked);
        }
       if (type[i].mobType=='MOBLK'){
            MOBLKG.checked='checked';
        }else if(type[i].mobType=='MOBLNK'){
            MOBLNKG.checked='checked';
        }else if(type[i].mobType=='MOBNLK'){
            MOBNLKG.checked='checked';
        }else if(type[i].mobType=='MOBNLNK'){
            MOBNLNKG.checked='checked';
        }else if(type[i].mobType=='InOR'){
            InORG.checked='checked';
        }

                if (type[i].waterCategory2=='lake'){
                      lake2G.checked='checked';
                  }else if(type[i].waterCategory2=='river'){
                      river2G.checked='checked';
                  }
             if (type[i].mobType2=='MOBLK'){
                  MOBLK2G.checked='checked';
              }else if(type[i].mobType2=='MOBLNK'){
                  MOBLNK2G.checked='checked';
              }else if(type[i].mobType2=='MOBNLK'){
                  MOBNLK2G.checked='checked';
              }else if(type[i].mobType2=='MOBNLNK'){
                  MOBNLNK2G.checked='checked';
              }else if(type[i].mobType2=='InOR'){
                  InOR2G.checked='checked';
              }

                  if (type[i].bodyType=='fresh'){
                      freshG.checked='checked';
                  }else if(type[i].bodyType=='salt'){
                      saltG.checked='checked';
                  }


                 if (type[i].waterCategory3=='lake'){
                     lake3G.checked='checked';
                 }else if(type[i].waterCategory3=='river'){
                     river3G.checked='checked';
                 }
                 if (type[i].mobType3=='MOBLK'){
                     MOBLK3G.checked='checked';
                 }else if(type[i].mobType3=='MOBLNK'){
                     MOBLNK3G.checked='checked';
                 }else if(type[i].mobType3=='MOBNLK'){
                     MOBNLK3G.checked='checked';
                 }else if(type[i].mobType3=='MOBNLNK'){
                     MOBNLNK3G.checked='checked';
                 }else if(type[i].mobType3=='InOR'){
                     InOR3G.checked='checked';
                 }

                 if (type[i].bodyType2=='fresh'){
                     fresh2G.checked='checked';
                 }else if(type[i].bodyType2=='salt'){
                     salt2G.checked='checked';
                 }
    }

    function changeThreat(id,key,value,threatType) {
        var myselect = document.getElementById(id);
        //获取大选择框即毒素名的选择
        var index = myselect.selectedIndex;
		var moblk = document.getElementById('moblk'+index).innerText;
        var moblnk = document.getElementById('moblnk'+index).innerText;
        var mobnlk = document.getElementById('mobnlk'+index).innerText;
        var mobnlnk = document.getElementById('mobnlnk'+index).innerText;
        var pers_lake = document.getElementById('persLake'+index).innerText;
        var pers_riv = document.getElementById('persRiv'+index).innerText;
        var mobValue = document.getElementById('mobValue'+index).innerText;
        var PerValue = document.getElementById('PerValueG'+index).innerText;
        var BioValue = document.getElementById('Bio_value'+index).innerText;
        var EcValue = document.getElementById("Ec_value"+index).innerText;
        var foodFresh = document.getElementById("foodFresh"+index).innerText;
        var foodSalt = document.getElementById("foodSalt"+index).innerText;
        var ecFresh = document.getElementById("EcFresh"+index).innerText;
        var ecSalt = document.getElementById("EcSalt"+index).innerText;
        var tox = document.getElementById('tox'+index).innerText;
        //赋值于type中，使之不会跳转回原来的选项
        type[index][key] = value;
        if(threatType =="water"){
            if(value=="lake"){
                document.getElementById("PerValueG"+index).innerHTML=pers_lake;
                document.getElementById("PerToxG"+index).innerHTML=(pers_lake*tox*mobValue).toFixed(3);
            }else  if(value=="river"){
                document.getElementById("PerValueG"+index).innerHTML=pers_riv;
                document.getElementById("PerToxG"+index).innerHTML=(pers_riv*tox*mobValue).toFixed(3);
            }
            if(value=="MOBLK"){
                document.getElementById("mobValue"+index).innerHTML=moblk;
                  document.getElementById("PerToxG"+index).innerHTML=(PerValue*tox*moblk).toFixed(3);
            }else  if(value=="MOBLNK"){
                document.getElementById("mobValue"+index).innerHTML=moblnk;
                 document.getElementById("PerToxG"+index).innerHTML=(PerValue*tox*moblnk).toFixed(3);
            }else  if(value=="MOBNLK"){
                document.getElementById("mobValue"+index).innerHTML=mobnlk;
               document.getElementById("PerToxG"+index).innerHTML=(PerValue*tox*mobnlk).toFixed(3);
            }else  if(value=="MOBNLNK"){
                document.getElementById("mobValue"+index).innerHTML=mobnlnk;
                 document.getElementById("PerToxG"+index).innerHTML=(PerValue*tox*mobnlnk).toFixed(3);
            }else  if(value=="InOR"){
                document.getElementById("mobValue"+index).innerHTML=1;
                 document.getElementById("PerToxG"+index).innerHTML=(PerValue*tox).toFixed(3);
            }
        }else  if(threatType =="food"){
            if(value=="lake"){
                document.getElementById("PerValue2G"+index).innerHTML=pers_lake;
                document.getElementById("PerTox2G"+index).innerHTML=(pers_lake*tox*mobValue*BioValue).toFixed(3);
            }else  if(value=="river"){
                document.getElementById("PerValue2G"+index).innerHTML=pers_riv;
                document.getElementById("PerTox2G"+index).innerHTML=(pers_riv*tox*mobValue*BioValue).toFixed(3);
            }
            if(value=="MOBLK"){
                document.getElementById("mobValue2"+index).innerHTML=moblk;
                document.getElementById("PerTox2G"+index).innerHTML=(PerValue*tox*moblk*BioValue).toFixed(3);
            }else  if(value=="MOBLNK"){
                document.getElementById("mobValue2"+index).innerHTML=moblnk;
                document.getElementById("PerTox2G"+index).innerHTML=(PerValue*tox*moblnk*BioValue).toFixed(3);
            }else  if(value=="MOBNLK"){
                document.getElementById("mobValue2"+index).innerHTML=mobnlk;
                document.getElementById("PerTox2G"+index).innerHTML=(PerValue*tox*mobnlk*BioValue).toFixed(3);
            }else  if(value=="MOBNLNK"){
                document.getElementById("mobValue2"+index).innerHTML=mobnlnk;
                document.getElementById("PerTox2G"+index).innerHTML=(PerValue*tox*mobnlnk*BioValue).toFixed(3);
            }else  if(value=="InOR"){
                document.getElementById("mobValue2"+index).innerHTML=1;
                document.getElementById("PerTox2G"+index).innerHTML=(PerValue*tox*BioValue).toFixed(3);
            }
            if(value=="fresh"){
                document.getElementById("Bio_value"+index).innerHTML=foodFresh;
                document.getElementById("PerTox2G"+index).innerHTML=(PerValue*tox*mobValue*foodFresh).toFixed(3);
            }else  if(value=="salt"){
                document.getElementById("Bio_value"+index).innerHTML=foodSalt;
                document.getElementById("PerTox2G"+index).innerHTML=(PerValue*tox*mobValue*foodSalt).toFixed(3);
            }
        }else  if(threatType =="environment"){
            if(value=="lake"){
                document.getElementById("PerValue3G"+index).innerHTML=pers_lake;
                document.getElementById("PerTox3G"+index).innerHTML=(pers_lake*EcValue*mobValue*BioValue).toFixed(3);
            }else  if(value=="river"){
                document.getElementById("PerValue3G"+index).innerHTML=pers_riv;
                document.getElementById("PerTox3G"+index).innerHTML=(pers_riv*EcValue*mobValue*BioValue).toFixed(3);
            }
            if(value=="MOBLK"){
                document.getElementById("mobValue3"+index).innerHTML=moblk;
                document.getElementById("PerTox3G"+index).innerHTML=(PerValue*EcValue*moblk*BioValue).toFixed(3);
            }else  if(value=="MOBLNK"){
                document.getElementById("mobValue3"+index).innerHTML=moblnk;
                document.getElementById("PerTox3G"+index).innerHTML=(PerValue*EcValue*moblnk*BioValue).toFixed(3);
            }else  if(value=="MOBNLK"){
                document.getElementById("mobValue3"+index).innerHTML=mobnlk;
                document.getElementById("PerTox3G"+index).innerHTML=(PerValue*EcValue*mobnlk*BioValue).toFixed(3);
            }else  if(value=="MOBNLNK"){
                document.getElementById("mobValue3"+index).innerHTML=mobnlnk;
                document.getElementById("PerTox3G"+index).innerHTML=(PerValue*EcValue*mobnlnk*BioValue).toFixed(3);
            }else  if(value=="InOR"){
                document.getElementById("mobValue3"+index).innerHTML=1;
                document.getElementById("PerTox3G"+index).innerHTML=(PerValue*EcValue*BioValue).toFixed(3);
            }
            if(value=="fresh"){
                document.getElementById("Bio_value2"+index).innerHTML=foodFresh;
                document.getElementById("Ec_value"+index).innerHTML=ecFresh;
                document.getElementById("PerTox3G"+index).innerHTML=(PerValue*ecFresh*mobValue*foodFresh).toFixed(3);
            }else  if(value=="salt"){
                document.getElementById("Bio_value2"+index).innerHTML=foodSalt;
                document.getElementById("Ec_value"+index).innerHTML=ecSalt;
                document.getElementById("PerTox3G"+index).innerHTML=(PerValue*ecSalt*mobValue*foodSalt).toFixed(3);
            }
        }

    }

    //按保存后再获取最大值
    function maxPersistenceCaculate(tox,substance,persistence,quantity,characteristicsId) {
        //  alert("哈哈哈");
        var sub = document.getElementById(substance+'G');
        var toxcity1 = new Array;
        var maxPersistence1 = 0;
        var maxPersistenceId1 = new Array;
        var maxId1=1;
        var bvalue = 1;
        for(t = 0;t<sdList.length;t++){
            //   alert(tox+t);
            toxcity1[t] = document.getElementById(tox+t).innerText;
            //  alert(toxcity1[t]);
            if( parseFloat(toxcity1[t])>parseFloat(maxPersistence1)){
                // alert(toxcity1[t]+">"+maxPersistence1);
                maxPersistence1= toxcity1[t];
                maxPersistenceId1.slice(0,maxPersistenceId1.length);
                maxPersistenceId1[0] =  t;
                maxId1=1;
            }else if( parseFloat(toxcity1[t])==parseFloat(maxPersistence1)){
                maxPersistenceId1[maxId1] = t;
                maxId1++;
            }
        }
        if(tox == 'PerTox2G'){
            var BioValue = document.getElementById('Bio_value'+maxPersistenceId1[0]).innerText;
            bvalue = bioa_valG.val();
            maxPersistence1 = maxPersistence1/BioValue;
        }
        if(tox=='PerTox3G'){
            var Bap_value = document.getElementById('Ec_value'+maxPersistenceId1[0]).innerText;
            bvalue=ecosystem_bap_valueG.val();
            maxPersistence1 = maxPersistence1/Bap_value;
        }
        //document.getElementById(persistence).value=maxPersistence1;
        $("#"+persistence).val(maxPersistence1);
        caculateHazaQuantity($("#"+quantity),maxPersistence1,$("#"+characteristicsId),bvalue);

        var op1 = "";
        for (i=0;i<maxPersistenceId1.length;i++){

           // alert(maxPersistenceId[i]);
            op1+="<option>"+sdList[maxPersistenceId1[i]].chnname+"</option>";
        }
        sub.innerHTML = op1;
    }


    function caculateHazaQuantity(quantity,persistence,characteristics,bValue) {
        if(parseFloat(persistence)<=0){
            quantity.val(0);
        }else if(parseFloat(persistence)>0&&parseFloat(persistence)<=100){
            quantity.val(1);
        }else if(parseFloat(persistence)>100&&parseFloat(persistence)<=10000){
            quantity.val(100);
        }else if(parseFloat(persistence)>10000&&parseFloat(persistence)<=1000000){
            quantity.val(10000);
        }else if(parseFloat(persistence)>1000000){
            quantity.val(1000000);
        }
        caculateCharacteristics(quantity,persistence,characteristics,bValue);
        caculateDrinking_water_score();
        caculateHuman_food_chain_score();
        caculateEnvironment_score();
    }

    function caculateCharacteristics(quantity,persistence,characteristics,bValue) {

        var t = quantity.val()*persistence*bValue;
        //alert(bValue);
        if(t ==0){
            characteristics.val(0);
        }else if(t>0&&t<10){
            characteristics.val(1);
        }else if(t>=10&&t<100){
            characteristics.val(2);
        }else if(t>=100&&t<1000){
            characteristics.val(3);
        }else if(t>=1000&&t<10000){
            characteristics.val(6);
        }else if(t>=10000&&t<100000){
            characteristics.val(10);
        }else if(t>=100000&&t<1000000){
            characteristics.val(18);
        }else if(t>=1000000&&t<10000000){
            characteristics.val(32);
        }else if(t>=10000000&&t<100000000){
            characteristics.val(56);
        }else if(t>=100000000&&t<1000000000){
            characteristics.val(100);
        }else if(t>=1000000000&&t<10000000000){
            characteristics.val(180);
        }else if(t>=10000000000&&t<100000000000){
            characteristics.val(320);
        }else if(t>=100000000000&&t<1000000000000){
            characteristics.val(560);
        }else if(t>=1000000000000){
            characteristics.val(1000);
        }
    }


    $("#myForm").validator({
        valid: function(form){
            var me = this;
            // 提交表单之前，hold住表单，防止重复提交
            me.holdSubmit();

            for(t = 0;t<sdList.length;t++){
                sdList[t].select_type = JSON.stringify(type[t]).replace(/\"/g,'\\"');
            }


            /*$.post("#springUrl('/surfaceWater/caculateScoreGroud/"+siteId+"')",$.param({'sdList':JSON.stringify(sdList)})+'&'+$(form).serialize(),function (data) {
                window.location.reload();
            },'json');*/


            $.ajax({
                type: 'POST',
                url: "#springUrl('/surfaceWater/caculateScoreGroud/"+siteId+"')",
                data: $.param({'sdList':JSON.stringify(sdList)})+'&'+$(form).serialize(),
                success: function (result) {
                    //alert('hhh');
                    parent.layer.alert("保存成功",function(){
                        parent.layer.closeAll();
                        window.parent.location.reload();
                    });
                },
                dataType: 'json'
            });
            parent.layer.alert("保存成功",function(){
                parent.layer.closeAll();
                window.parent.location.reload();
            });
         /*   $.ajax({
                url: "#springUrl('/surfaceWater/caculateScoreGroud')",
                data: $(form).serialize(),
                type: "POST",
                success: function(data){
                    // alert(data);
                    //   var d = JSON.parse(data);
                    var d = data;
                    if(d.equals('success')){
                        window.parent.location.reload();
                        //当你在iframe页面关闭自身时
                        //var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                        //parent.layer.close(index); //再执行关闭
                    } else {
                        //失败，提交表单成功后，释放hold，如果不释放hold，就变成了只能提交一次的表单
                        me.holdSubmit(false);
                    }
                }
            });*/
        }
    });

    function  openThreat(id,fade) {
        var light = document.getElementById(id);
        var top =  document.documentElement.scrollTop;
        light.style.display='block';
        document.getElementById(fade).style.display='block';
        // light.style.top = (document.documentElement.clientHeight-light.height)/2+top + 'px';
        light.style.top = top+light.style.height/2 -50 + 'px' ;
    }

    function closeThreat(id,fade) {
        var light = document.getElementById(id);
        light.style.display='none';
        var fadeD = document.getElementById(fade);
        fadeD.style.display='none';
    }
    function selectIn(key,value) {
        key.children("option").each(function(){
            var temp_value = $(this).val();
            if(parseFloat(temp_value) == value){
                $(this).attr("selected","selected");
            }
        });
    }

    $(function () {
        bsStep(3);
        tableCreate();
        if(gid != 0){
			selectIn(observed_release,'${surfaceWaterGW.observed_release}');
			selectIn(containment,'${surfaceWaterGW.containment}');
			selectIn(net_precip,'${surfaceWaterGW.net_precip}');
			selectIn(depth_to_auuifer,'${surfaceWaterGW.depth_to_auuifer}');
			selectIn(travel_time,'${surfaceWaterGW.travel_time}');
			selectIn(nearest_intake,'${surfaceWaterGW.nearest_intake}');
			selectIn(resource,'${surfaceWaterGW.resource}');
			selectIn(food_chain_individual,'${surfaceWaterGW.food_chain_individual}');
			selectIn(bioa_valG,'${surfaceWaterGW.bioa_val}');
			selectIn(ecosystem_bap_valueG,'${surfaceWaterGW.ecosystem_bap_value}');
		}else {
            $('#gid').val(0);
		}
        decodeMessageG();
        maxPersistenceCaculate('PerToxG','substance','persistence','haza_quantityG','waste_characteristicsG');
        maxPersistenceCaculate('PerTox2G','substance2','persistence2','haza_quantity2G','waste_characteristics2G');
 	    maxPersistenceCaculate('PerTox3G','substance3','persistence3','haz_waster_quantityG','waste_chaG');
        observed_release.change(function () {
            caculateLikeihood_release();
        });

        containment.change(function () {
            //alert("ssss")
            caculatePro_to_release();
        });

        net_precip.change(function () {
            caculatePro_to_release();
        });

        depth_to_auuifer.change(function () {
            caculatePro_to_release();
        });

        travel_time.change(function () {
            caculatePro_to_release();
        });

        pop_concent1.change(function () {
            //alert('hhh')
			caculatePopulationG();
        });
        pop_concent2.change(function () {
            //alert('hhh')
            caculatePopulationG();
        });
        potential_contanmination.change(function () {
           // alert('hhh')
            caculatePopulationG();
        });
        nearest_intake.change(function () {
			caculateTarget();
        });
        resource.change(function () {
            caculateTarget();
        });

        pop_concent12.change(function () {
            caculatePopulation2();
        });
        pop_concent22.change(function () {
            caculatePopulation2();
        });
        pot_HFC_concent.change(function () {
            caculatePopulation2();
        });
        food_chain_individual.change(function () {
			caculateTarget2();
        });

        pop_concent13.change(function () {
            caculatePop_sensitive_environments();
        });
        pop_concent23.change(function () {
            caculatePop_sensitive_environments();
        });
        potential_contanmination3.change(function () {
            caculatePop_sensitive_environments();
        });
        bioa_valG.change(function () {
            caculateHazaQuantity(haza_quantity2,persistence2.val(),waste_characteristics2,bioa_valG.val());
        });
        ecosystem_bap_valueG.change(function () {
            caculateHazaQuantity(haz_waster_quantity,persistence3.val(),waste_cha,ecosystem_bap_valueG.val());
        });

    });



    function caculatePro_to_release() {
        potential_to_release.val(containment.val()*(net_precip.val()*1+depth_to_auuifer.val()*1+travel_time.val()*1));
       // alert(potential_to_release.val());
        caculateLikeihood_release();
    }

    function caculateLikeihood_release() {
        if (parseInt(observed_release.val())>parseInt(potential_to_release.val())){
            likeihood_release.val(observed_release.val());
            likeihood_release2.val(observed_release.val());
            likeihood_release3.val(observed_release.val());
            caculateDrinking_water_score();
            caculateHuman_food_chain_score();
            caculateEnvironment_score();
		}else {
            likeihood_release.val(potential_to_release.val());
            likeihood_release2.val(potential_to_release.val());
            likeihood_release3.val(potential_to_release.val());
            caculateDrinking_water_score();
            caculateHuman_food_chain_score();
            caculateEnvironment_score();
		}
    }

    function caculatePopulationG() {
        //alert('hhh');
        var pop = pop_concent1.val()*10+pop_concent2.val()*1+potential_contanmination.val()*0.1;
        population.val(pop.toFixed(2));
        caculateTarget();
    }

    function caculateTarget() {
        target.val(nearest_intake.val()*1+population.val()*1+resource.val()*1);
        caculateDrinking_water_score();
    }

    function caculateDrinking_water_score() {
        uncapped_score.val(((likeihood_release.val()*waste_characteristics.val()*target.val())/82500).toFixed(2));
        if(parseFloat(uncapped_score.val())>100){
            drinking_water_score.val(100);
            caculateWatershed_score();
        }else {
            drinking_water_score.val(uncapped_score.val());
            caculateWatershed_score();
		}
    }

    function caculatePopulation2() {
        population2.val((pop_concent12.val()*10+pop_concent22.val()*1+pot_HFC_concent.val()*0.1).toFixed(2));
        caculateTarget2();
    }
    
    function caculateTarget2() {
        target2.val(food_chain_individual.val()*1+population2.val()*1);
        caculateHuman_food_chain_score();
    }

    function caculateHuman_food_chain_score() {
        uncapped_score2.val(((likeihood_release2.val()*waste_characteristics2.val()*target2.val())/82500).toFixed(2));
        if(parseFloat(uncapped_score2.val())>100){
            human_food_chain_score.val(100);
            caculateWatershed_score();
        }else {
            human_food_chain_score.val(uncapped_score2.val());
            caculateWatershed_score();
        }
    }

    function caculatePop_sensitive_environments() {
        pop_sensitive_environments.val((pop_concent13.val()*10+pop_concent23.val()*1+potential_contanmination3.val()*0.1).toFixed(2));
        target3.val(pop_sensitive_environments.val());
        caculateEnvironment_score();
    }

    function caculateEnvironment_score() {
        uncapped_score3.val(((likeihood_release3.val()*waste_cha.val()*target3.val())/82500).toFixed(2));
        if(parseFloat(uncapped_score3.val())>100){
            environment_score.val(100);
            caculateWatershed_score();
        }else {
            environment_score.val(uncapped_score3.val());
            caculateWatershed_score();
        }
    }

    function caculateWatershed_score() {
        var score = (drinking_water_score.val()*1+human_food_chain_score.val()*1+environment_score.val()*1).toFixed(2);
        if(parseFloat(score)>100){
            watershed_score.val(100);
        }else {
            watershed_score.val(score);
        }
    }

    function openErr(id) {
        //alert(id);
        $('#'+id+'ErrMsg').css('display','block');
    }
    function closeErr(id) {
        $('#'+id).parent().css('display','none');
    }
    function isDigit(s)
    {
        var patrn=/^[0-9]{1,20}$/;
        if (!patrn.exec(s)) {
            // alert("false");
            return false;
        }
        // alert("true");
        return true;
    }

    function surface(id) {
        var title = "表"+id;
        var url = "#springUrl('/surfaceWater/surface"+id+".html')";
        layer.open({
            type: 2,
            title: title,
            shadeClose: true,
            shade: 0.8,
            area: ['760px', '430px'],
            fix: false,
            maxmin: false,
            content: url
        });
    }
</script>

